<? include("admin/function.php"); ?>

<?
$stt = mysetting();
$r = Q1("select * from  product where pd_id = '".$_REQUEST['pd_id']."' order by pd_order  desc ");
$rpic1 = Q2("select img_pic,img_id,img_name1 from images where na_id='".$r['pd_id']."'  and tables = 'product'  order by img_order desc ");

$sdfsdf=0;
?>

<div class="showproduct" >

<div  >
<a href="#" onclick="javascript:myback();"><img <?=btswap()?> src="images/back.jpg"  width="34" height="130"></a><img  src="imgs/<?=str_replace(".","-swap.",$rpic1['0']['img_pic'])?>" height="130" border="0">
</div>


	<div>
    <h3 style="font-weight:bold;padding:0;margin:0;">"<? if($_SESSION[lng]==1) echo $r['pd_name']; else echo $r['pd_name2'];?>"</h3>
    <h4 style="padding:0;margin:0;">Price : <?=number_format($r['pd_price'])?> <?=$r['pd_unit']?> / <?=number_format($r['pd_price2'])?> <?=$r['pd_unit2']?></h4>
   
    <h5 style="padding:0;margin:0;font-weight:lighter;">Quantity
    <select name="Quantity" onchange="javascript:pdea=this.value;">
    <? for($i=1;$i<=99;$i++){ ?>
    <option value="<?=$i?>"><?=$i?></option>
    <? } ?>
    </select>
    </h5>
	<br>
    <p >
    <?
		
		$newlink = "ajax_addtocart.php";
	?>
        <span id="addcart">
            <a href="#" onclick="showdiv('addcart','<?=$newlink?>?pd_id=<?=$r['pd_id']?>&img_id='+img_id);return false;"><img src="images/addtobagx.gif" alt="Add to cart" title="Add to cart" height="40" /></a>
        </span> 
    <?
	//***************************************************************************************************
	//WHISLIST
		
		 
		 $newlink = "ajax_addtowhislist.php";

	?>        
        <span id="addwhishlist"> 
            <a href="#" onclick="showdiv('addwhishlist','<?=$newlink?>?pd_id=<?=$r['pd_id']?>&img_id='+img_id);return false;"><img src="images/addtowishlistx.gif" alt="Add to whislist" title="Add to whislist" height="40"  /></a><br />
		
        </span>
            
    </p>
    </div>
	
	 <div style="margin-top:5px;;font-weight:lighter;">
		Your size : <span style='display:block;overflow:auto;width:100px;height:100px;border:1px solid black;'>
		<? $isize1 = explode("|",$r['pd_size']); foreach($isize1 as $key => $isize2) { ?>
		<?if($isize2!=""){?>
		<input type='checkbox' onclick='xxx(this)' value='<?=$isize2?>'> <?=$isize2?><br/>
		<?}?>
		
		<? } ?>
		</span>
	</div>
    
    <div class="gallery clearfix" style="width:300px;" >
    <?
	foreach($rpic1 as $rpic)
	{
    
	?>
    <a href="#" onclick="javascript:pdcolor='<?=$rpic['img_name1']?>';showbody('imgs/<?=$rpic['img_pic']?>');img_id='<?=$rpic[img_id]?>';return false;"><img alt="<?=$rpic['img_name1']?>" title="<?=$rpic['img_name1']?>" style="padding:10px;" height="50" src="imgs/<?=str_replace(".","-swap.",$rpic['img_pic'])?>"></a>
    <?
	}
	?>
    </div>
    
    <div style="padding-top:20px;"  >
    Desception : <? if($_SESSION[lng]==1) echo $r['pd_dese']; else echo $r['pd_dese2'];?>
    </div>




</div>